﻿@{      
    Layout = "../Shared/_Default.cshtml";
    ViewBag.PageTitle = T(Res.Name("Title"), 
        JDM.Int32(Model.EntityID), 
        JDM.Guid(Model.Guid));
}

@section Toolbar
{
    <a href="@Url.Action(Loc.Act("PdfReport").Set(new
    {
        id = JDM.Int32(Model.EntityID)
    }).Localized())">@T(Res.Name("PdfReport"))</a>
    @if(JDM.HasFlags(Model.Flags, "Canceled"))
    {
        <span class="separator">&middot;</span>
        <a href="@Url.Action(Loc.Act("Issue").Set(new
        {
            id = JDM.Int32(Model.EntityID)
        }).Localized())">@T(Res.Name("Issue"))</a>
    }
    else if(JDM.HasFlags(Model.Flags, "Pending"))
    {
        <span class="separator">&middot;</span>
        <a class="confirm" href="@Url.Action(Loc.Act("Cancel").Set(new
        {
            id = JDM.Int32(Model.EntityID)
        }).Localized())">@T(Res.In("Common").Of("Act").Name("Cancel"))</a>
        <span class="separator">&middot;</span>
        <a href="@Url.Action(Loc.Act("Confirm").Set(new
        {
            id = JDM.Int32(Model.EntityID)
        }).Localized())">@T(Res.In("Common").Of("Act").Name("Confirm"))</a>
    }
    else if(JDM.HasFlags(Model.Flags, "Confirmed"))
    {
        <span class="separator">&middot;</span>
        <a class="confirm" href="@Url.Action(Loc.Act("Cancel").Set(new
        {
            id = JDM.Int32(Model.EntityID)
        }).Localized())">@T(Res.In("Common").Of("Act").Name("Cancel"))</a>
    }
}
@section Sidebar
{
    @{
        Html.RenderPartial("_Overview");
    }
}
<div class="box">
    <section>
    @{
        Html.RenderPartial("_Items", (object)Model.Items);
    }
    </section>
</div>
<div class="box">
    <header>
        <h3>@T(Res.Name("Invoices"))</h3>
    </header>
    <section>
    @{
        Html.RenderAction(Loc.Act("_Grid").Ctrl("Invoice").Set(new
        {
            orderID = JDM.Int32(Model.EntityID)
        }).Localized());
    }
    </section>
</div>
<div class="box">
    <header>
        <h4>@T(Res.Name("Comments"))</h4>
    </header>
    <section>
    @{
        Html.RenderAction(Loc.Act("_Comments").Set(new
        {
            id = JDM.Int32(Model.EntityID)
        }).Localized());
    }
    </section>
</div>